package qtdz2;

public class World {
    public static void main(String[] args) {
        SeaObject[] submarine = new SeaObject[6];
        submarine[0] = new MineSubmarine();
        submarine[1] = new MineSubmarine();
        submarine[2] = new ObserveSubmarine();
        submarine[3] = new ObserveSubmarine();
        submarine[4] = new TorpedoSubmarine();
        submarine[5] = new TorpedoSubmarine();
        for (int i = 0; i < submarine.length; i++) {
            SeaObject s = submarine[i];
            System.out.println(s.x + "," + s.y + "," + s.speed);
            s.move();
        }
        Mine[] mine = new Mine[3];
        mine[0] = new Mine(100, 220);
        mine[1] = new Mine(120, 120);
        mine[2] = new Mine(150, 150);
        for (int i = 0; i < mine.length; i++) {
            Mine m = mine[i];
            System.out.println(m.x + "," + m.y + "," + m.speed);
            m.move();
        }
        Bomb[] bomb = new Bomb[3];
        bomb[0] = new Bomb(100, 123);
        bomb[1] = new Bomb(150, 200);
        bomb[2] = new Bomb(200, 250);
        for (int i = 0; i < bomb.length; i++) {
            Bomb b = bomb[i];
            System.out.println(b.x + "," + b.y + "," + b.speed);
            b.move();
        }


    }
}
